package quartz.demo2;

import java.text.ParseException;

import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.triggers.CronTriggerImpl;

import com.design.demo3.List;

import quartz.demo1.RequestJobUrl;

public class test2 {
	public static void test1() throws Exception{
		SchedulerFactory schedulerFactory = new StdSchedulerFactory();
		Scheduler scheduler = schedulerFactory.getScheduler();
		//创建任务
        JobDetail jobDetail = JobBuilder.newJob(TestJob.class).withIdentity("job1", "group1").build();
        CronTriggerImpl trigger = new CronTriggerImpl();// 触发器名,触发器组
		trigger.setName("job1");
		trigger.setGroup("group1");
		trigger.setCronExpression("0/5 * 16 ? * *");// 触发器时间设定
		//将任务及其触发器放入调度器
        scheduler.scheduleJob(jobDetail, trigger);
        //调度器开始调度任务
        scheduler.start();
        
        

	}
	public static void main(String[] args) throws Exception {
		test2.test1();
	}

}
